<?php
namespace common\models\FriendLink;
use Yii;
use common\models\LinkType\LinkType;
use yii\helpers\ArrayHelper;
/**
 * This is the model class for table "friend_link".
 *
 * @property integer $link_id
 * @property string $link_name
 * @property string $link_url
 * @property string $link_logo
 * @property integer $show_order
 * @property integer $lid
 */
class FriendLink extends \yii\db\ActiveRecord
{
	public $typename;
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'friend_link';
    }
	
    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['show_order', 'lid'], 'integer'],
            [['lid'], 'required'],
            [['link_name', 'link_url', 'link_logo'], 'string', 'max' => 255],
        ];
    }
    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
		    'lid' => Yii::t('app', '类别名称'),
            'link_id' => Yii::t('app', 'ID'),
            'link_name' => Yii::t('app', '链接名称'),
            'link_url' => Yii::t('app', '链接'),
            'link_logo' => Yii::t('app', '图片 Logo'),
            'show_order' => Yii::t('app', 'Show Order'),
           
        ];
    }
	public static function getLinkType($id){
		return LinkType::findOne($id)->typename;
	
	}
}
